<div id="container">
<section id="content"> 
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">

	$(document).ready(function(){
		var listSubStr = $("#hidListSub").val();
		var arraySub = listSubStr.split(",");
		for(var i = 0; i < arraySub.length; i++){
			$("#selSubId option[value='" + arraySub[i] + "']").prop("selected","selected");
		}
	});

	function func_back(){
		$("#main_form").prop("action", "edit");
		return $("#main_form").submit();
	}

	
</script>
<form id="main_form" method="post" action="registEdit">
	<input type="hidden" name="id" id="hidId" value="<?php echo $id;?>"/>
	<input type="hidden" name="listSubs" id="hidListSub" value="<?php echo $listSubs;?>"/>
	<input type="hidden" name="name" id="hidName" value="<?php echo $name;?>"/>
	<input type="hidden" name="descript" id="hidDescript" value="<?php echo $descript;?>"/>
	<input type="hidden" name="money" id="hidMoney" value="<?php echo $money; ?>" />
	<center>
		<H1>Chỉnh Sửa Khóa Học</H1>
	</center>
	<table id="edit_table">
		<tr>
			<td class="edit_column" width="170">Tên khóa học</td>
			<td style="text-align: left;"><?php echo html_entity_decode($name, ENT_QUOTES, 'utf-8');?></td>
		</tr>
		<tr>
			<td class="edit_column" width="170">Học phí</td>
			<td style="text-align: left;"><?php echo $money;?> (VNĐ)</td>
		</tr>
		<tr>
			<td class="edit_column">Môn học</td>
			<td>
				<?php foreach ($subjects AS $subject) :?>
					<?php echo $subject['Subject']['sub_name']?><br/>
				<?php endforeach;?>	
			</td>
		</tr>
		<tr>
			<td class="edit_column" style="vertical-align: top;">Mô tả khóa học</td>
			<td style="text-align: left;">
				<textarea name="descript" id="txtDescript"
				style="width: 99%;" rows="20" disabled><?php echo html_entity_decode($descript, ENT_QUOTES, 'utf-8');?></textarea>
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align: center;">
				<button type="submit">Xác Nhận</button>
				<button type="button" onclick="func_back()">Quay Lại</button>
			</td>
		</tr>
	</table>
</form>
</section>
</div>

